export function showSimpleDialog(
    title: string,
    text: string,
    confirmed: () => void = () => {}
) {
    showDialog(title, text, '确认', '取消', () => {
    }, confirmed)
}

export function showDialog(
    title: string,
    text: string,
    confirmButton: string,
    cancelButton: string,
    canceled: () => void,
    confirmed: () => void
) {
    ElMessageBox.confirm(
        text,
        title,
        {
            confirmButtonText: confirmButton,
            cancelButtonText: cancelButton,
            type: 'warning',
        }
    )
        .then(() => {
            confirmed()
        })
        .catch(() => {
            canceled()
        })
}